package com.gemme.gemme.wode;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import androidx.annotation.NonNull;

import com.gemme.gemme.BaseActivity;
import com.gemme.gemme.R;
import com.gemme.gemme.login.Constant;
import com.gemme.gemme.login.MsgActivity;
import com.gemme.gemme.test.MyPhotoFragment;
import com.gemme.gemme.view.Topview;
import com.jaeger.library.StatusBarUtil;
import com.luck.picture.lib.config.PictureConfig;
import com.luck.picture.lib.config.PictureMimeType;
import com.luck.picture.lib.tools.PictureFileUtils;

//侧滑删除地址
public class TokenActivity extends BaseActivity{


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_token);
        initTop();
        initView();
    }

    private void initView() {

        findViewById(R.id.Token).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                try {
                    SharedPreferences MSP = getSharedPreferences(Constant.MSP, Context.MODE_PRIVATE);
                    MSP.edit().putString(Constant.ACCESS_TOKEN, "").apply();
                    String ACCESS_TOKEN = MSP.getString(Constant.ACCESS_TOKEN, "").trim();
                    System.out.println("");
                }catch (Exception e){

                }

            }
        });


      try {
          SharedPreferences MSP = getSharedPreferences(Constant.MSP, Context.MODE_PRIVATE);
          EditText et_token = findViewById(R.id.et_token);
          String access_token = MSP.getString(Constant.ACCESS_TOKEN, "").trim();
          et_token.setText(access_token + "");
          System.out.println("access_token : " + access_token);
      }catch (Exception e){

      }
    }


    private void initTop() {
//        StatusBarUtil.setColor(this,getResources().getColor(R.color.white_color) );
        StatusBarUtil.setTransparent(this);
//        StatusBarUtil.setTranslucent(this,250);
        Topview topview = findViewById(R.id.topview);
        topview.setContentText("获取Token");
    }





}